<template>
  <div>
    {{ currentRole }}
    <maintain-select v-if="option" :option="option" />
  </div>
</template>

<script>
import { getStationListToolBar } from '@/api/station'
import MaintainSelect from '@/components/MaintainSelect/index.vue'
export default {
  name: 'Dashboard',
  components: {
    MaintainSelect
  },
  data() {
    return {
      currentRole: 'adminDashboard',
      option: []
    }
  },
  created() {
    this.getStationListToolBar()
  },
  methods: {
    getStationListToolBar() {
      getStationListToolBar().then(res => {
        this.option = [
          {
            'id': 42,
            'name': '站点公司3',
            'children': [
              {
                'id': 47,
                'name': '南工大',
                'status': '离线',
                'wiring': 'http://ddapi.nz-cloud.com/upload/wiring/47.svg',
                'model': 'http://ddapi.nz-cloud.com/upload/model/47.svg',
                'company_id': 42,
                'operator_id': 51
              },
              {
                'id': 67,
                'name': 'g工程部测试',
                'status': '离线',
                'wiring': 'http://ddapi.nz-cloud.com/',
                'model': 'http://ddapi.nz-cloud.com/',
                'company_id': 42,
                'operator_id': 51
              }
            ]
          },
          {
            'id': 43,
            'name': '站点公司4'
          },
          {
            'id': 51,
            'name': '广西香江一号10kV变电所',
            'children': [
              {
                'id': 48,
                'name': '香江一号10kV变电所',
                'status': '离线',
                'wiring': 'http://ddapi.nz-cloud.com/upload/wiring/48.svg',
                'model': 'http://ddapi.nz-cloud.com/upload/model/48.svg',
                'company_id': 51,
                'operator_id': 51
              }
            ]
          },
          {
            'id': 52,
            'name': '宿迁雅泰科技园公司',
            'children': [
              {
                'id': 49,
                'name': '雅泰科技产业园中心站',
                'status': '离线',
                'wiring': 'http://ddapi.nz-cloud.com/upload/wiring/49.svg',
                'model': 'http://ddapi.nz-cloud.com/upload/model/49.svg',
                'company_id': 52,
                'operator_id': 51
              },
              {
                'id': 50,
                'name': '宿迁雅泰科技园2#配电房',
                'status': '离线',
                'wiring': 'http://ddapi.nz-cloud.com/upload/wiring/50.svg',
                'model': 'http://ddapi.nz-cloud.com/upload/model/50.svg',
                'company_id': 52,
                'operator_id': 51
              },
              {
                'id': 51,
                'name': '雅泰科技园3#配电房',
                'status': '离线',
                'wiring': 'http://ddapi.nz-cloud.com/upload/wiring/51.svg',
                'model': 'http://ddapi.nz-cloud.com/upload/model/51.svg',
                'company_id': 52,
                'operator_id': 51
              },
              {
                'id': 52,
                'name': '雅泰科技园5#配电房',
                'status': '离线',
                'wiring': 'http://ddapi.nz-cloud.com/upload/wiring/52.svg',
                'model': 'http://ddapi.nz-cloud.com/upload/model/52.svg',
                'company_id': 52,
                'operator_id': 51
              }
            ]
          },
          {
            'id': 53,
            'name': '世茂外滩',
            'children': [
              {
                'id': 58,
                'name': '世贸外滩8#开关站',
                'status': '在线',
                'wiring': 'http://ddapi.nz-cloud.com/',
                'model': 'http://ddapi.nz-cloud.com/',
                'company_id': 53,
                'operator_id': 51
              },
              {
                'id': 59,
                'name': '世贸外滩20#配电室',
                'status': '在线',
                'wiring': 'http://ddapi.nz-cloud.com/',
                'model': 'http://ddapi.nz-cloud.com/',
                'company_id': 53,
                'operator_id': 51
              },
              {
                'id': 60,
                'name': '世贸外滩21号配电室',
                'status': '在线',
                'wiring': 'http://ddapi.nz-cloud.com/',
                'model': 'http://ddapi.nz-cloud.com/',
                'company_id': 53,
                'operator_id': 51
              },
              {
                'id': 61,
                'name': '世贸外滩20-1#配电室',
                'status': '离线',
                'wiring': 'http://ddapi.nz-cloud.com/',
                'model': 'http://ddapi.nz-cloud.com/',
                'company_id': 53,
                'operator_id': 51
              },
              {
                'id': 62,
                'name': '世贸外滩22#配电室',
                'status': '在线',
                'wiring': 'http://ddapi.nz-cloud.com/',
                'model': 'http://ddapi.nz-cloud.com/',
                'company_id': 53,
                'operator_id': 51
              }
            ]
          },
          {
            'id': 55,
            'name': '海南檀溪新型材料有限公司',
            'children': [
              {
                'id': 63,
                'name': '3.715MW分布式光伏站',
                'status': '离线',
                'wiring': 'http://ddapi.nz-cloud.com/upload/wiring/63.svg',
                'model': 'http://ddapi.nz-cloud.com/',
                'company_id': 55,
                'operator_id': 51
              }
            ]
          },
          {
            'id': 56,
            'name': '徐州睢宁县广电中心',
            'children': [
              {
                'id': 64,
                'name': '睢宁电视台10kV组合配电室',
                'status': '在线',
                'wiring': 'http://ddapi.nz-cloud.com/upload/wiring/64.svg',
                'model': 'http://ddapi.nz-cloud.com/',
                'company_id': 56,
                'operator_id': 51
              }
            ]
          },
          {
            'id': 57,
            'name': '中国石油化工有限公司石油物探技术研究院',
            'children': [
              {
                'id': 65,
                'name': '中石化物探院卫岗400V配电工程',
                'status': '在线',
                'wiring': 'http://ddapi.nz-cloud.com/upload/wiring/65.svg',
                'model': 'http://ddapi.nz-cloud.com/upload/model/65.svg',
                'company_id': 57,
                'operator_id': 51
              }
            ]
          }
        ]
        // console.log(res.data.data)
      })
    }
  }
}
</script>
